package com.zzw.controller;

import com.zzw.entity.Auth;
import com.zzw.entity.Result;
import com.zzw.service.AuthService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Project: warehouse
 * @Description:
 * @Author: zzw
 */
@RestController
@RequestMapping("/auth")
@Slf4j
@Api(tags = "权限模块")
public class AuthController {

    @Autowired
    private AuthService authService;

    /**
     * 查询整个权限树的url接口
     *
     * @return
     */
    @ApiOperation(value = "查询完整权限树")
    @GetMapping("/auth-tree")
    public Result allAuthTree() {
        List<Auth> allAuthTree = authService.allAuthTree();
        return Result.ok(allAuthTree);
    }

    //校验name的唯一性 get

    //校验url的唯一性 get

    //校验code的唯一性 get

    //添加权限 post





}
